package com.codi.bus.core.resultModel;

import com.codi.base.util.DateUtils;
import com.codi.base.util.MoneyUtils;
import com.codi.bus.core.service.model.T0Model;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @author lvgo
 * @version 1.0
 * @Description: 首页点击瑞福宝返回模型
 * @date 18-7-3 上午10:57
 */
@Data
public class WalletListResult extends BaseResult {


    /**
     * 瑞福宝资产数据
     */
    private WalletData walletData;
    /**
     * t0 list
     */
    private List<T0Model> t0Models;

    @Data
    public static class WalletData {

        /**
         * 当日收益
         */
        private BigDecimal tti;
        private String totalTodayIncome;
        /**
         * 累计收益
         */
        private BigDecimal ti;
        private String totalIncome;
        /**
         * 总资产
         */
        private BigDecimal twv;
        private String totalWorthValue;
        /**
         * 总在途金额
         */
        private BigDecimal inTransitAmount;

        public String getCurrentDate() {
            return DateUtils.formatDate7(new Date());
        }

        public String getInTransitAmountString() {
            if (inTransitAmount != null && inTransitAmount.doubleValue() != 0.00) {
                StringBuffer sb = new StringBuffer();
                sb.append("买入待确认");
                sb.append(MoneyUtils.formatMoney(inTransitAmount));
                return sb.toString();
            }
            return "";
        }

    }
}
